<?php
/**
 * Created by PhpStorm.
 * User: fangwei
 * Date: 2020-01-05
 * Time: 20:52
 */

namespace App\Http\Requests\Admin;


use Illuminate\Foundation\Http\FormRequest;

class OrderInputDTO extends FormRequest
{
    public function authorize()
    {
        return true;
    }

    public function rules()
    {
        return [
            'client_name' => 'required|max:20',
            'mobile' => 'required|max:200',
            'email' => 'required|max:200',
            'province' => 'required',
            'city' => 'required',
            'area' => 'required',
            'address' => 'required',
            'mark' => 'required',
            'product' => 'required|array',
        ];
    }

    public function messages()
    {
        return [
            'text.required' => '广告描述不能为空',
            'text.max' => '广告描述不能超过20个字符',
            'description.required' => '广告用途不能为空',
            'description.max' => '广告用途不能超过200个字符',
            'type_id.required' => '栏目不能为空',
            'plate_type.required' => '链接类型不能为空',
            'picture.required' => '图片地址不能为空',
            'picture.max' => '图片地址不能超过200个字符',
            'space_id.required' => '广告位不能为空',
            'link.required' => '广告链接地址不能为空',
            'sort.required' => '排序不能为空',
            'begin.required' => '广告开始时间不能为空',
            'end.required' => '广告结束时间不能为空',
        ];
    }
}